package com.it.tydic.estate.common.util;

import com.github.pagehelper.PageHelper;

import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class CommonUtils {
	
	public static PageHelper pageProcess(Map<String,Object> record){
		PageHelper pageHelper = new PageHelper();
		if(record.containsKey("pageNum")&& record.containsKey("pageSize")){//判断是否有分页条件
			int pageNum =(Integer)record.get("pageNum");
			int pageSize =(Integer)record.get("pageSize");
			if(0==pageNum){//如为0，则设默认值
				pageNum = 1;
			}
			if(0==pageSize){
				pageSize = 20;
			}
			pageHelper.startPage(pageNum, pageSize);
		}
		return pageHelper;
	}
	


}
